package com.ruoyi.function.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.function.mapper.RoadSectionDistanceMapper;
import com.ruoyi.function.domain.RoadSectionDistance;
import com.ruoyi.function.service.IRoadSectionDistanceService;

/**
 * 主线站点间里程实测数据Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-11
 */
@Service
public class RoadSectionDistanceServiceImpl implements IRoadSectionDistanceService 
{
    @Autowired
    private RoadSectionDistanceMapper roadSectionDistanceMapper;

    /**
     * 查询主线站点间里程实测数据
     * 
     * @param id 主线站点间里程实测数据主键
     * @return 主线站点间里程实测数据
     */
    @Override
    public RoadSectionDistance selectRoadSectionDistanceById(Long id)
    {
        return roadSectionDistanceMapper.selectRoadSectionDistanceById(id);
    }

    /**
     * 查询主线站点间里程实测数据列表
     * 
     * @param roadSectionDistance 主线站点间里程实测数据
     * @return 主线站点间里程实测数据
     */
    @Override
    public List<RoadSectionDistance> selectRoadSectionDistanceList(RoadSectionDistance roadSectionDistance)
    {
        return roadSectionDistanceMapper.selectRoadSectionDistanceList(roadSectionDistance);
    }

    /**
     * 新增主线站点间里程实测数据
     * 
     * @param roadSectionDistance 主线站点间里程实测数据
     * @return 结果
     */
    @Override
    public int insertRoadSectionDistance(RoadSectionDistance roadSectionDistance)
    {
        return roadSectionDistanceMapper.insertRoadSectionDistance(roadSectionDistance);
    }

    /**
     * 修改主线站点间里程实测数据
     * 
     * @param roadSectionDistance 主线站点间里程实测数据
     * @return 结果
     */
    @Override
    public int updateRoadSectionDistance(RoadSectionDistance roadSectionDistance)
    {
        return roadSectionDistanceMapper.updateRoadSectionDistance(roadSectionDistance);
    }

    /**
     * 批量删除主线站点间里程实测数据
     * 
     * @param ids 需要删除的主线站点间里程实测数据主键
     * @return 结果
     */
    @Override
    public int deleteRoadSectionDistanceByIds(Long[] ids)
    {
        return roadSectionDistanceMapper.deleteRoadSectionDistanceByIds(ids);
    }

    /**
     * 删除主线站点间里程实测数据信息
     * 
     * @param id 主线站点间里程实测数据主键
     * @return 结果
     */
    @Override
    public int deleteRoadSectionDistanceById(Long id)
    {
        return roadSectionDistanceMapper.deleteRoadSectionDistanceById(id);
    }

    /**
     * 是否存在子节点
     * 
     * @param id 节点ID
     * @return 结果 true 存在 false 不存在
     */
    @Override
    public boolean hasChildById(Long id)
    {
        int result = roadSectionDistanceMapper.hasChildById(id);
        return result > 0;
    }
}
